<?php
/**
 * Smarty plugin
 * @category VaselinEngine
 * @package Smarty
 * @subpackage plugins
 */


/**
 * Smarty {select} function plugin
 *
 * Type:     function<br>
 * Name:     select<br>
 * Purpose:  print out select field. Used by Bel_Forms_Builder
 * @author Konstantin Shamko <konstantin.shamko@gmail.com>
 * @param array parameters
 * @param Smarty
 * @return string|null
 */
function smarty_function_select($params, &$smarty) {
	//smarty_function_html_options
	require_once $smarty->_get_plugin_filepath ( 'function', 'html_options' );
	$params['id'] = $params['name'].'_id';
	if (isset ( $params ['multiple'] )) {
		$params ['name'] = $params ['name'] . '[]';
	}
	$params ['options'] = $params ['options'] [0];
	$_html_result = smarty_function_html_options ( $params, $smarty );
	echo $_html_result;
}
